<?php

namespace App\Http\Resources;
// +----------------------------------------------------------------------
// | Copyright (c) 2024~至今 迪钰国际旅行社 版权所有.
// +----------------------------------------------------------------------
// | Author: dxf &lt;xiangfei2007@126.com&gt;
// +----------------------------------------------------------------------
// | Date: 2024/8/22 16:43
// +----------------------------------------------------------------------

use Illuminate\Http\Resources\Json\JsonResource;

class DictResource extends JsonResource
{
    /**
     * @param \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id'         => $this->id,
            'name'       => $this->name,
            'slug'       => $this->slug,
            'value'      => json_decode($this->value),
            'created_at' => (string)$this->created_at,
            'updated_at' => (string)$this->updated_at,
        ];
    }
}
